<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>遮罩</title>
    <style>
        body {
            background: url(../css/img/abcd.jpg)
        }

        .mask {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .box {
            width: 300px;
            padding: 20px;
            background: white;
            border-radius: 5px;
            position: relative;
        }

        .close {
            position: absolute;
            width: 20px;
            height: 20px;
            border: 1px solid black;
            border-radius: 50%;
            top: -10px;
            right: -10px;
            font-size: 20px;
            text-align: center;
            line-height: 20px;
            cursor: pointer;
        }

        h3,
        p {
            text-align: center;
        }
    </style>
</head>

<body>
    <div class="mask">
        <div class="box">
            <div class="close">×</div>
            <h3>提示</h3>
            <p>点击右上角的×可以关闭这个弹窗</p>
        </div>
    </div>

</body>
<script>
    document.querySelector('.close').addEventListener('click', () =>
        document.querySelector('.mask').style.display = 'none'
    )
</script>

</html>